#include "stream.h"


stream::stream()
{
	clear();
}


stream::~stream()
{
}

void stream::write(unsigned char ch)
{
	if (ptr + 1 > STREAM_LEN)return;

	io[ptr] = ch;
	ptr++;
}

int stream::len()
{
	return ptr;
}

void stream::clear()
{
	for (int i = 0; i < STREAM_LEN; i++) {
		io[i] = 0;
	}
	ptr = 0;
}

unsigned char * stream::get()
{
	return io;
}
